<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="admin"/>
        <title>Author List</title>
    </head>
    <body>
        
        <div class="body">
            <g:form action="searchUser" method="get" >
                <input type="text" name="searchKey"><input type="submit" value="搜索">
            </g:form>
            <g:if test="${flash.message}">
                <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table class="full">
                    <thead>
                        <tr>

                            <g:sortableColumn property="id" title="Id"/>

                            <g:sortableColumn property="username" title="Username"/>

                            <th>Name</th>

                            <g:sortableColumn property="email" title="Email"/>

                            <th>操作</th>

                        </tr>
                    </thead>
                    <tbody>
                        <g:each in="${authorInstanceList}" status="i" var="authorInstance">
                            <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

                                <td><g:link action="show" id="${authorInstance.id}">${fieldValue(bean: authorInstance, field: 'id')}</g:link></td>

                                <td>${fieldValue(bean: authorInstance, field: 'username')}</td>

                                <td><g:link controller="home" action="blog" id="${authorInstance.id}">${fieldValue(bean: authorInstance, field: 'name')}</g:link></td>

                                <td>${fieldValue(bean: authorInstance, field: 'email')}</td>
                                
                                <td><g:formatBoolean boolean="${authorInstance.enabled}" /><g:link controller="author" action="goswitch" id="${authorInstance.id}">${authorInstance.enabled?"关闭":"开启"}
                            </g:link></td>
                            </tr>
                        </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${Author.count()}"/>
            </div>
        </div>
    </body>
</html>
